Common JavaScript Mistake And Common JavaScript Mistake. Why You Can’t Attach Custom Properties to JavaScript Strings. Why You Can’t Add Properties to JavaScript Primitive Strings. Adding Properties to String Primitives
Lets explain the Code: const str = "hello" ; str. data = "val" ; console . log (str. data ); Step 1…